<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ include file="../general/header.jsp" %>
	<div id="header">My Items</div>
	<%@ include file="../general/menu.jsp" %>
	<div id="content">
			<div>
				<table class="listas">
					<tr style="font-weight:bold;"> 
						<td>Name</td> 
						<td>Price</td> 
						<td>Descripction</td> 
						<td>Publication Date</td> 				 					
						<td>Stock</td> 
						<td>Condition</td> 
						<td>Visit Counter</td> 
						<td>Owner</td> 
						<td>Category</td>
						<td>Type</td>
					</tr>
					<c:forEach var="item" items="${items}">
						<tr>
							<td> <a href="itemDetail?itemid=<c:out value='${item.id}' /> "> <c:out value="${item.name}" /> </a> </td> 
		 					<td> <c:out value="${item.precio}" /> </td> 
							<td> <c:out value="${item.description}" /> </td> 
							<td> <fmt:formatDate type="date" value="${item.publicationDate}" />	</td> 				 					
							<td> <c:out value="${item.count}" /> </td> 
							<td>
								<c:choose>
								<c:when test="${item.newItem == 'true'}">
									New	
								</c:when>
								<c:otherwise>
									Used
								</c:otherwise>
							</c:choose>
							</td> 
							<td> <c:out value="${item.visitCounter}" /> </td> 
							<td> <c:out value="${item.user.name}" /> </td> 
							<td> <c:out value="${item.category.name}" /> </td>
							<td> <c:out value="${item.type}" /> </td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</div>
<br/>
<a href="../general/index">Go Back to Index</a>
<script type="text/javascript">
	hideDirection();
</script>
<%@ include file="../general/footer.jsp" %>
